#!/bin/bash
# 用户必须输入用户名，未输入密码默认123456

read -p "请输入用户名：" name

if [ -z  $name ];then
	echo "输入用户名"
	exit 2
fi

stty -echo
read -p "请输入密码：" pass
stty echo

pass=${pass:-123456}

useradd "$name"
echo "$pass" | passwd --stdin $name
